<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String BASE_PATH = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title>全国企业风险库</title>
    <link rel="stylesheet" href="${BASE_PATH}static/css/commen.css"/>
    <link rel="stylesheet" href="${BASE_PATH}static/css/SuperSlide.css"/>
    <link rel="stylesheet" href="${BASE_PATH}static/css/public.css">
    <link rel="stylesheet" href="${BASE_PATH}static/css/counBus.css"/>
</head>
<body>
<div class="g_coun_head">
    <div class="g_coun_head_main clearfix">
        <a class="g_c_h_m_logo fl" href="${BASE_PATH}index.jsp"></a>
        <ul class="g_c_h_m_lists fl">
            <li class="active"><a href="${BASE_PATH}index.jsp">首页</a></li>
            <li><a href="${BASE_PATH}businessRisk.jsp">企业风险榜单</a></li>
            <li><a href="${BASE_PATH}focus.jsp">企业风险聚焦</a></li>
        </ul>
        <div class="g_c_h_m_user fr">
            <a href="" class="g_c_h_m_login fl ">登录</a>
            <a href="" class="g_c_h_m_registe active fl">免费注册</a>
        </div>
    </div>
    <p class="g_coun_h_shandow"></p>
</div>
<div class="g_coun_carousel fullSlide">
    <div class="bd">
        <ul>
            <li style="background:red;background-size:100% 100%;height:556px" onclick=""></li>
            <li style="background:blue;background-size:100% 100%;height:556px" onclick=""></li>
            <li style="background:green;background-size:100% 100%;height:556px" onclick="">
                <input type="hidden" name="" value=""/>
            </li>
        </ul>
    </div>
    <div class="hd">
        <ul></ul>
    </div>
    <div class="prev">
        <div class="prev_arrow"></div>
    </div>
    <div class="next">
        <div class="next_arrow"></div>
    </div>
    <div class="g_coun_car_main">
        <h1 class="g_coun_car_title">
            企业风险查询中心
        </h1>

        <div class="g_coun_car_search clearfix">
            <input type="text" name="" class="g_coun_car_se_intex fl" id=""
                   placeholder="请输入企业名、人名、产品名或其它关键词，多关键词用空格隔开，如“北京   小米科技"/>
            <input type="button" name="" id="" value="查处罚" class="g_coun_car_se_sub" onclick="window.location.href='${BASE_PATH}search.jsp'"/>
        </div>
        <div class="g_coun_car_lists clearfix">
            <div class="fl g_coun_car_list_noma">热搜词&nbsp;:&nbsp;</div>
            <div class="fl g_coun_car_li_all" id="g_coun_car_li_all">
            </div>
        </div>
    </div>
</div>
<div class="g_coun_nav_bg">
    <div class="g_coun_nav clearfix">
        <div class="fl g_coun_nav_list_l">
            <p class="g_coun_car_businiss"></p>

            <p class="g_coun_nav_l_top">8700万+企业</p>

            <p>监控全国企业诉讼、失信、处罚信息</p>
        </div>
        <div class="fl g_coun_nav_list_c">
            <p class="g_coun_car_source"></p>

            <p class="g_coun_nav_l_top">8000+来源</p>

            <p>实时、同步更新全国政府公示权威网站</p>
        </div>
        <div class="fl g_coun_nav_list_r">
            <p class="g_coun_car_action"></p>

            <p class="g_coun_nav_l_top">惩戒动态</p>

            <p>累计数据 <span class="colRed" id="cumuData"></span> 今日新增 <span class="colRed" id="todayData"></span></p>
        </div>
    </div>
</div>
<div class="g_coun_division_bg">
    <div class="g_coun_division">
        <div class="g_coun_di_head">
            <h1 class="g_coun_di_title">全国企业处罚TOP榜</h1>
            <span class="g_coun_di_more" onclick="jumpBus();">更多&nbsp;></span>
        </div>
        <div class="g_coun_di_selects clearfix" id="g_coun_di_selects">
            <div class="g_coun_di_se_choi fl">
                <span class="g_coun_di_se_ch_title fl">选择&nbsp;:&nbsp;</span>
                <select id="selelt_type" name="">
                    <option value="">请选择</option>
                    <option value="1">按金额</option>
                    <option value="2">按次数</option>
                </select>
            </div>
            <div class="g_coun_di_se_choi fl">
                <span class="g_coun_di_se_ch_title fl">时间&nbsp;:&nbsp;</span>
                <select id="select_time" name="">
                    <option value=""></option>
                </select>
            </div>
        </div>
        <div class="g_coun_di_main clearfix" id="g_coun_di_main">
            <div class="g_coun_di_main_l fl">
                <div class="g_coun_di_m_l_title fl">
                    <span class="g_coun_di_m_active g_coun_di_m_ac_name">企业名称</span>
                    <span class="g_coun_di_m_active g_coun_di_m_ac_corpo ">企业法人</span>
                    <span class="g_coun_di_m_active g_coun_di_m_ac_money select_money_cound">金额（万）</span>
                </div>
                <div id="g_coun_di_m_l_lists">
                </div>
            </div>
            <div class="g_coun_di_main_r fl">
                <div class="g_coun_di_m_r_title fl">
                    <span class="g_coun_di_m_normal g_coun_di_m_nor_name">企业名称</span>
                    <span class="g_coun_di_m_normal g_coun_di_m_nor_corpo">企业法人</span>
                    <span class="g_coun_di_m_normal g_coun_di_m_nor_money select_money_cound">金额（万）</span>
                </div>

                <div id="g_coun_di_m_r_lists">
                </div>
            </div>
        </div>
    </div>
</div>
<div class="g_coun_riscFocs_bg">
    <div class="g_coun_riscFocs">
        <h1 class="g_coun_riFo_title">全国企业风险聚焦</h1>

        <div class="g_coun_riFo_search" onclick="jumpFocus()">更多&nbsp;></div>
        <div class="g_coun_riFo_progress">
            <ul></ul>
        </div>
        <div class="g_coun_riFo_lists">
            <div class="g_coun_riFo_li_l fl"></div>
            <ul class="fl g_coun_riFo_listMain" id="g_coun_riFo_listMain">
            </ul>
            <div class="g_coun_riFo_li_r fl"></div>
        </div>
    </div>
</div>

<div class="g_coun_foot">
    <div class="g-coun_borBott">
        <div class="g_coun_f_main">
            <div class="g_coun_f_m_top clearfix">
                <div class="g_coun_f_m_t_l fl">
                    <h2 class="g_coun_f_m_t_title fl">企业风险</h2>
                    <ul class="g_coun_f_m_t_list fl">
                        <li>关于我们</li>
                        <li>免责声明</li>
                        <li>服务协议</li>
                        <li>权利通知</li>
                        <li>意见反馈</li>
                        <li>数据服务</li>
                        <li>常见问题</li>
                        <li> 版权声明</li>
                    </ul>
                </div>
                <div class="g_coun_f_m_t_c fl">
                    <h2 class="g_coun_f_m_t_title">联系我们</h2>

                    <p>企业邮箱：xxxxxx@xxxxx.com</p>

                    <p>客服电话：888888888</p>
                </div>
                <div class="g_coun_f_m_t_r fr">
                    <div class="fl g_coun_f_m_t_r_l">
                        <p class="g_coun_f_m_t_r_l_title">微信公众号</p>

                        <p class="g_coun_f_m_t_r_l_pic"></p>
                    </div>
                    <div class="fl g_coun_f_m_t_r_l">
                        <p class="g_coun_f_m_t_r_l_title">征信查APP</p>

                        <p class="g_coun_f_m_t_r_l_pic"></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="g-coun_borTop">
        <div class="g_coun_f_main">
            <div class="g_coun_f_m_bottom">
                <p>版权所有：xxxxxxxxx@2016 JINDIDATA 京ICP备 xxxxxxx</p>

                <p>京公网安备 11010802021795号</p>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${BASE_PATH}static/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="${BASE_PATH}static/js/SuperSlide.js"></script>
<script type="text/javascript">
    var selTime = ["2017-01","2017-02","2017-03","2017-04","2017-05"];//查询时间的日期数组
    var selTimeHtml = '<option value="">请选择</option>';
    for(var i=0;i<selTime.length;i++){
        selTimeHtml +='<option value="'+ selTime[i] +'">'+selTime[i] +'</option>'
    }
    $("#select_time").html(selTimeHtml);
    $("#selelt_type").val("1").trigger("change");
    $("#g_coun_di_selects").on("change","select",function(){
        riskTop();
    })
    $(function(){
        dataShow ();
        /* 调用SuperSlide */
        $(".g_coun_riscFocs").slide({
            titCell:".g_coun_riFo_progress ul",
            mainCell: ".g_coun_riFo_lists .g_coun_riFo_listMain",
            effect: "leftLoop",
            autoPlay: false,
            autoPage: true,
            trigger: "click",
            prevCell:".g_coun_riFo_li_l",
            nextCell:".g_coun_riFo_li_r"
        });
    })

    function dataShow (){
        var indexUrl = '${BASE_PATH}risk/index';//首页展示信息查询接口
        $.ajax({
            url:indexUrl,
            type:'post',
            async: false,
            dataType:'json',
            success:function(data){
                var data1 = data.data;
                var hotSearch = "";
                $.each(data1.hotword,function(i,item){
                    hotSearch += '<span class="fl">'+ item +'</span>';
                })
                var punishtopL = "";  //全国企业处罚TOP榜左侧
                var punishtopR = "";  //全国企业处罚TOP榜右侧
                if(data1.punishtop!=""){
                    $.each(data1.punishtop,function(j,jtem){
                        var jj = parseInt(j) + 1;
                        var claN = '';
                        if(jj<=3){
                            claN = "g_coun_di_m_l_l_num_active";
                        }else {
                            claN = "";
                        }
                        var html = //
                                '<div class="g_coun_di_m_l_lists">'+
                                '	<span class="g_coun_di_m_l_l_num '+ claN +'">'+ jj +'</span>'+
                                '	<div class="g_coun_di_m_l_l_text fl">'+
                                '		<span class="g_coun_di_m_l_l_name" title="g_coun_di_m_l_l_name" onclick="jumpDetail('+ jtem.id +')">'+ jtem.company +'</span>'+
                                '		<span class="g_coun_di_m_l_l_person">'+ jtem.corporation+'</span>'+
                                '		<span class="g_coun_di_m_l_l_money">'+ jtem.moneyortime+'</span>'+
                                '	</div>'+
                                '</div>';
                        if(j<10){
                            punishtopL +=html;
                        }else if(j>=10&&j<20){
                            punishtopR +=html;
                        }
                    })
                }
                console.log(data);
                var riskfocusHtml = ""//全国企业风险聚焦
                if(data1.riskfocus!=""){
                    var kk = 0 ;
                    var ktem = "";
                    for(var k = 0 ; k<data1.riskfocus.length;k++){
                        ktem = data1.riskfocus[k];
                        if(k==0||k==4||k==8||k==12||k==16){
                            riskfocusHtml+='<li class="g_coun_riFo_li_main clearfix">';
                        }
                        if(k==0|| (k%2)==0){
                            class1="g_coun_riFo_li_m_l_list";
                            if(kk == 0){
                                riskfocusHtml+='<div class="g_coun_riFo_li_m_l fl">';
                                kk++;
                            }else {
                                riskfocusHtml+='<div class="g_coun_riFo_li_m_r fl">';
                                kk = 0;
                            }
                        }else {
                            class1="";
                        }
                        riskfocusHtml+=//
                                '<div class="'+ class1 +'  clearfix">'+
                                '	<div class="g_coun_riFo_li_m_l_l_pic fl"><img onclick="jumpFocusCon('+ ktem.id +')" src="'+ktem.imgpath+'"></div>'+
                                '	<div class="g_coun_riFo_li_m_l_l_text fl">'+
                                '		<div class="g_coun_riFo_li_m_l_l_t_t">'+
                                '			<p class="g_coun_riFo_li_m_l_l_t_inner" onclick="jumpFocusCon('+ ktem.id +')">'+ ktem.title +'</p>'+
                                '			<p class="g_coun_riFo_li_m_l_l_t_busi">企业主体：<span onclick="jumpFocusCon('+ ktem.id +')">'+ktem.company+'</span></p>'+
                                '		</div>'+
                                '		<div class="g_coun_riFo_li_m_l_l_t_b">'+
                                '			<p class="g_coun_riFo_li_m_l_l_t_b_per">参与人数：'+ktem.partake+'</p>'+
                                '			<p class="g_coun_riFo_li_m_l_l_t_b_tim">发布时间：'+ktem.publishtime+'</p>'+
                                '		</div>'+
                                '	</div>'+
                                '</div>';
                        if(k!=0 && (k%2) > 0){
                            riskfocusHtml+='</div>';
                        }
                        if(k==3||k==7||k==11||k==15){
                            riskfocusHtml+='</li>';
                        }
                    }
                }
                $("#cumuData").html(data1.datacount);//总累计量
                $("#todayData").html(data1.todaygrow);//今日累计量
                $("#g_coun_car_li_all").html(hotSearch);//热搜词
                $("#g_coun_di_m_l_lists").html(punishtopL);//全国企业处罚TOP榜左侧
                $("#g_coun_di_m_r_lists").html(punishtopR);//全国企业处罚TOP榜右侧
                $("#g_coun_riFo_listMain").html(riskfocusHtml);//全国企业风险聚焦
            },
            error:function(error){
                alert("error")
            }
        })
    }
    //选择查询方法
    function riskTop(){
        var type = $("#selelt_type").val();//查询类型	type	1按金额2按次数
        var time = $("#select_time").val();//查询时间	time	查询年月  例 2017-03
        var searchUrl = '${BASE_PATH}risk/punishTop';//根据条件查询的接口
        $.ajax({
            url:searchUrl,
            data:{
                type:type,
                time:time
            },
            type:'post',
            async: false,
            dataType:'json',
            success:function(data){
                if(data.code==-1){
                    alert("查询失败");
                    return;
                }
                if(type == 2){
                    $(".select_money_cound").html("次数（次）");
                }else {
                    $(".select_money_cound").html("金额（万）");
                }
                console.log(data);
                var data1=data.data;
                var punishtopL = "";  //全国企业处罚TOP榜左侧
                var punishtopR = "";  //全国企业处罚TOP榜右侧
                if(data1.punishtop!=""){
                    $.each(data1,function(i,item){
                        var ii = parseInt(i) + 1;
                        var claN = '';
                        if(ii<=3||ii>=11&&ii<=13){
                            claN = "g_coun_di_m_l_l_num_active";
                        }else {
                            claN = "";
                        }
                        var html = //
                                '<div class="g_coun_di_m_l_lists">'+
                                '	<span class="g_coun_di_m_l_l_num '+ claN +'">'+ ii +'</span>'+
                                '	<div class="g_coun_di_m_l_l_text fl">'+
                                '		<span class="g_coun_di_m_l_l_name" title="g_coun_di_m_l_l_name" onclick="jumpDetail('+ item.id +')">'+ item.company +'</span>'+
                                '		<span class="g_coun_di_m_l_l_person">'+ item.corporation+'</span>'+
                                '		<span class="g_coun_di_m_l_l_money">'+ item.moneyortime+'</span>'+
                                '	</div>'+
                                '</div>';
                        if(i<10){
                            punishtopL +=html;
                        }else if(i>=10&&i<20){
                            punishtopR +=html;
                        }
                    })
                }
                $("#g_coun_di_m_l_lists").html(punishtopL);//全国企业处罚TOP榜左侧
                $("#g_coun_di_m_r_lists").html(punishtopR);//全国企业处罚TOP榜右侧
            }
        })
    }
    //跳转页面
    function jumpDetail(id){
        window.location.href='${BASE_PATH}searchDetail.jsp?id='+id;
    }
    function jumpFocusCon (id){
        window.location.href='${BASE_PATH}focus_con.jsp?id='+id;
    }
    function jumpFocus (){
        window.location.href='${BASE_PATH}focus.jsp';
    }
    function jumpBus(){
        window.location.href='${BASE_PATH}businessRisk.jsp';
    }
</script>
<script type="text/javascript">
    /* 控制左右按钮显示 */
    jQuery(".prev").hover(function () {
        jQuery(".prev_arrow").addClass("new_prev_arrow").show();
    }, function () {
        jQuery(".prev_arrow").removeClass("new_prev_arrow").hide();
    });
    jQuery(".next").hover(function () {
        jQuery(".next_arrow").addClass("new_next_arrow").show();
    }, function () {
        jQuery(".next_arrow").removeClass("new_next_arrow").hide();
    });
    /* 调用SuperSlide */
    jQuery(".g_coun_carousel").slide({
        titCell: ".hd ul",
        mainCell: ".bd ul",
        effect: "fold",
        autoPlay: true,
        autoPage: true,
        trigger: "click",
        startFun: function (i) {
            var curLi = jQuery(".g_coun_carousel .bd li").eq(i);
            /* 当前大图的li */
            if (!!curLi.attr("_src")) {
                curLi.css("background-image", curLi.attr("_src")).removeAttr("_src")
                /* 将_src地址赋予li背景，然后删除_src */
            }
        }
    });
</script>
<script type="text/javascript">
    $(function () {
        $(".g_coun_car_main").css("left", (Math.floor(window.screen.width - 1200) / 2) + 'px');
    })
</script>
</body>

</html>